#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
#include<queue>
#include <vector>


struct node
{
	int a, b, c;
	bool operator<(const node& x)const
	{
		return b > x.b;
	}
};

int main()
{
	priority_queue<node> q;

	for (int i = 1; i <= 10; i++)
	{
		q.push({ i+5,i + 2,i });
	}

	while (q.size())
	{
		node t = q.top();
		cout << t.a << " " << t.b << " " << t.c << " " << endl;
		q.pop();
	}
	return 0;
}